#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(ui->pushButton,&QPushButton::clicked,this,&Widget::handeClick);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handeClick()
{
    this->setWindowTitle("修改标题");
}

void Widget::handeClick2()
{
    this->setWindowTitle("修改");
}

void Widget::on_pushButton_2_clicked()
{
    disconnect(ui->pushButton,&QPushButton::clicked,this,&Widget::handeClick);
    connect(ui->pushButton,&QPushButton::clicked,this,&Widget::handeClick2);
}

